/**
 * Created by MyPC on 2017/6/12.
 */
let pageNum = 1,    //当前页数
  pageSize = 10;    //每页显示条数

function Page(req) {
  let page = {
    query: {}
  };
  let query = parseInt(req.query.pageNum);
  if (!isNaN(query) || query<1) {
    page.pageNum = query;
  } else {
    page.pageNum = pageNum;
  }
  query = parseInt(req.query.pageSize);
  if (!isNaN(query) || query<10) {
    page.pageSize = query;
  } else {
    page.pageSize = pageSize;
  }
  return page;
}
module.exports = Page;